package com.wc.alorithm_blue_bridge._数学知识.快速幂.Q7935;

/**
 * @Author congege
 * @Description
 * @Date Created in 2023/12/19-22:12
 */
public class Main {

    public static void main(String[] args) {
        System.out.println(qkm(2,2023,1000));
    }

    public static long qkm(int a, int b, int p) {
        long ans = 1;
        while (b > 0) {
            if ((b & 1) == 1) {
                ans = ans * a % p;
            }
            a = a * a % 1000;
            b >>= 1;
        }
        return ans;
    }
}
